package com.struct.graph.room
{
	import com.component.ComponentChildren;
	import com.utils.Utils;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	public class RoleShow extends ComponentChildren
	{
		private var txtKey:TextField;
		private var txtName:TextField;
		public function RoleShow(name:String, roleSource:BitmapData, key:Boolean = false)
		{
			super();
			
			width = 64;
			height = 84;
			
			var bitMap:Bitmap = new Bitmap(roleSource);
			addChild(bitMap);
			if(key){
				Utils.createTextField(this, 0, 0, "房主", 12, 0xff0000, true);
			}
			Utils.createTextField(this, 0, 64, name, 12, 0x0, true, TextFieldAutoSize.CENTER, width);
			
			graphics.beginFill(0x00ff00);
			graphics.drawRect(0, 0, width, height);
			graphics.drawRect(2, 2, width - 4, height - 4);
			graphics.endFill();
		}
	}
}